package cn.iocoder.yudao.module.trade.service.order.handler;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.map.MapUtil;
import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
import cn.iocoder.yudao.module.system.api.sms.SmsCodeApi;
import cn.iocoder.yudao.module.system.service.sms.SmsSendService;
import cn.iocoder.yudao.module.trade.convert.order.TradeOrderConvert;
import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderDO;
import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderItemDO;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import static java.util.Collections.singletonList;

/**
 * 订单支付之后 短信通知
 *
 * @author 曹建伟
 */
@Component
public class TradeOrderMessageHandler implements TradeOrderHandler{

    @Resource
    private SmsSendService smsSendService;

    @Override
    public void afterPayOrder(TradeOrderDO order, List<TradeOrderItemDO> orderItems) {
        smsSendService.sendSingleSms("13609269612", 250L, UserTypeEnum.MEMBER.getValue(),
                "admin_notify_code", MapUtil.of("code", 9999));

        smsSendService.sendSingleSms("18192569845", 250L, UserTypeEnum.MEMBER.getValue(),
                "admin_notify_code", MapUtil.of("code", 9999));
    }
}
